<script>
import computedProxy from "@/utils/tools/ComputedProxy";

export default {
  name: "searchForm",
  props: {
    form: {
      type: Object,
      default: () => ({}),
      required: true,
    }
  },
  computed: {
    formData: {
      get() {
        return new Proxy(this.form, computedProxy(this, 'form-change'))
      },
      set(val) {
        this.$emit('form-change', val)
      },
    },
  }
}
</script>

<template>
  <el-form :model="formData">
    <el-input v-model="formData.value" clearable placeholder="请输入关键词搜索">
      <template #prepend>search</template>
    </el-input>
  </el-form>
</template>

<style scoped>

</style>